import { createRouter, createWebHashHistory } from "vue-router";
import commonRoutes from "./route.common.js";
import exceptionRoutes from "./route.exception.js";
const routes = [
  {
    path: "/",
    redirect: "/home",
  },
  ...commonRoutes,
  ...exceptionRoutes,
];

const router = createRouter({
  // 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
  history: createWebHashHistory(),
  routes, // `routes: routes` 的缩写
});

router.beforeEach((to, form) => {
  document.title = process.env.VUE_APP_TITLE;
});
router.afterEach((to, form) => {});

export default router;
